package com.wholesale.commons;

import com.wholesale.R;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.widget.ImageView;

/**
 * 边框ImageView
 * 
 * @author davelin
 * 
 */
public class BoderImageView extends ImageView {
	public BoderImageView(Context context) {
		super(context);
	}

	@Override
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);
		// 画边框 暂时去除小边框
		Rect rec = canvas.getClipBounds();
		rec.bottom--;
		rec.right--;
		Paint paint = new Paint();
		paint.setColor(R.color.Gray);
		paint.setStyle(Paint.Style.STROKE);
		canvas.drawRect(rec, paint);
	}

}
